// structinit.c
// gcc structinit.c

#include <stdio.h>
#include <stdlib.h>
/*
typedef struct Student
{
    char name[10];
    int  eng;
    int  math;
}STUDENT;
*/
struct Student
{
    char name[10];
    int  eng;
    int  math;
};

typedef struct Student STUDENT;

int main()
{
    STUDENT stu = {"Jack", 90, 85};
    
    printf("Name\tEng\tMath\tSum\tAvg\n");
    printf("---------------------------------------\n");
    printf("%s\t%d\t%d\t%d\t%.2f\n", 
           stu.name, 
           stu.eng, 
           stu.math,
           stu.eng + stu.math,
           (stu.eng + stu.math) / 2.0 );
    printf("\n");
    system("pause");
    return 0;
}
